<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <!--<link rel="stylesheet" href="">-->
    <script type="text/javascript" src="vue/vue.min.js"></script>

</head>
<body>
<div id="app">
    <!--v-model读取value的值-->
    <input type="text" v-model="txt" @focus="txt=''" @blur="txt='默认值'">
    <!--接收vue中data的值-->
    <div>{{ txt }}</div>
    <!--v-model.lazy开始并不显示输入数据，知道完成回车或点击其他即显示-->
    <input type="text" v-model.lazy="msg">
    <div>{{msg}}</div>
    <select v-model="select">
        <option value="0">html</option>
        <option value="1">css</option>
        <option value="2">js</option>
    </select>
    <div>{{ select }}</div>
    <p>{{text}}</p>
    <!--{{text}} 放在textarea标签内无效-->
    <textarea v-model="text" placeholder="add multiple lines"></textarea>
</div>
</body>
<script type="text/javascript">
    var vm = new Vue({
        el:"#app",
        data:{
            // 接收v-model的值
            txt:"默认值",
            select:0,
            text:"",
            msg: ""
        },
    })
</script>

</html>